package com.boot.unity.api.wx.controller;


import com.alibaba.fastjson.JSONObject;
import com.boot.unity.api.wx.service.WxIndexService;
import com.boot.unity.api.wx.utils.ResponseUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;


import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 测试服务
 */
@RestController
@RequestMapping("/wx/index")
@Validated
public class WxIndexController {
    private final Log logger = LogFactory.getLog(WxIndexController.class);

    @Autowired
    private WxIndexService wxIndexService;
    /**
     * 首页数据
     *
     * @return
     */
    @PostMapping("/index")
    public Object index() {
        JSONObject index = wxIndexService.index();
        return index;

    }

    /**
     * 检测当前用户是否完成培训
     * @return
     */
    @PostMapping("/check")
    @GetMapping("/check")
    public Object check(String uid,String key){
        return wxIndexService.check(uid,key);
    }
}
